package pers.ree.demo.designpattern.singleton;

/**
 * 单例：饿汉模式
 */
public class HungrySingleton {
    // todo final是不是一定要加？
    // 参考https://www.jianshu.com/p/e22ca93024f3
    private static final HungrySingleton instance = new HungrySingleton();


    private HungrySingleton() {

    }


    public static HungrySingleton getInstance() {
        return instance;
    }
}
